package com.demo.ObjectOutputStream_;

import java.io.Serializable;

/**
 * @author gy
 * @date 2022/4/5
 */
public class Dog implements Serializable {

    private String name;
    private String age;
    /**
     *     被 static修饰 无法序列化
     */
    private static String nation;
    /**
     *     被 transient 修饰 无法序列化
     */
    private transient String color;
    private Master master;

    public Dog(String name, String age, String color, Master master) {
        this.name = name;
        this.age = age;
        this.color = color;
        this.master = master;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", color='" + color + '\'' +
                ", master=" + master +
                '}' + nation;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public static String getNation() {
        return nation;
    }

    public static void setNation(String nation) {
        Dog.nation = nation;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Master getMaster() {
        return master;
    }

    public void setMaster(Master master) {
        this.master = master;
    }
}
